from flask import Flask,render_template,send_file
import os
import random
app = Flask(__name__)
@app.route("/")
def home():
    return render_template('a.html')
@app.route("/index")
def index():
    return "你是sb"
@app.route("/rand")
def rand():
    img_list_path = os.listdir('static/img')
    img_list_path_len = len(img_list_path)
    rand_num = random.randint(0,img_list_path_len-1)
    return send_file(os.path.join('static/img/',img_list_path[rand_num]))
@app.route("/b8")
def reb8():
    return send_file('static/img/b8.jpg')
@app.route("/b15")
def reb15():
    return send_file('static/img/b15.png')
@app.route("/b18")
def reb18():
    return send_file('static/img/b18.png')
@app.route("/b24")
def reb24():
    return send_file('static/img/b24.png')
if __name__ == '__main__':
    app.run(host='0.0.0.0',port=5000)
